import django_filters

from .models import Goods


class GoodsFilter(django_filters.rest_framework.FilterSet):
    """
    商品的过滤类
    """
    code = django_filters.CharFilter(field_name='good_category__category_code')

    class Meta:
        model = Goods
        fields = ['code', 'is_hot', 'is_new']
